Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Event (computing)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Event_(computing)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Event_computing rootpage-Event_computing skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Event (computing)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<p>In <a href="Computing" title="Computing">computing</a>, an <b>event</b> is a detectable occurrence or change in the system's state, such as user input, hardware interrupts, system notifications, or changes in data or conditions, that the system is designed to monitor. Events trigger responses or actions and are fundamental to event-driven systems. These events can be handled synchronously, where the execution <a href="Thread_(computing)" title="Thread (computing)">thread</a> is blocked until the event handler completes its processing, or asynchronously, where the event is processed independently, often through an <a href="Event_loop" title="Event loop">event loop</a>. Even when synchronous handling appears to block execution, the underlying mechanism in many systems is still asynchronous, managed by the event loop.<sup id="cite_ref-:0_1-0" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:3_2-0" class="reference"><a href="#cite_note-:3-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p><p>Events can be implemented through various mechanisms such as <a href="Callback_(computer_programming)" title="Callback (computer programming)">callbacks</a>, message objects, signals, or interrupts, and events themselves are distinct from the implementation mechanisms used. Event propagation models, such as <a href="Event_bubbling" title="Event bubbling">bubbling</a>, capturing, and pub/sub, define how events are distributed and handled within a system. Other key aspects include event loops, event queueing and prioritization, event sourcing, and complex event processing patterns. These mechanisms contribute to the flexibility and scalability of <a href="Event-driven_programming" title="Event-driven programming">event-driven systems</a>.<sup id="cite_ref-:0_1-1" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:3_2-1" class="reference"><a href="#cite_note-:3-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup>
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Events_vs._Messages">Events vs. Messages</h2></div>
<p>In <a href="Distributed_computing" title="Distributed computing">distributed systems</a>, events represent a fact or state change (e.g., <i>OrderPlaced</i>) and are typically broadcast asynchronously to multiple consumers, promoting loose coupling and scalability. While events generally don’t expect an immediate response, acknowledgment mechanisms are often implemented at the infrastructure level (e.g., Kafka commit offsets, SNS delivery statuses) rather than being an inherent part of the event pattern itself.<sup id="cite_ref-:1_3-0" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:2_4-0" class="reference"><a href="#cite_note-:2-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p><p>In contrast, <a href="Message" title="Message">messages</a> serve a broader role, encompassing commands (e.g., <i>ProcessPayment</i>), events (e.g., <i>PaymentProcessed</i>), and documents (e.g., <i>DataPayload</i>). Both events and messages can support various delivery guarantees, including at-least-once, at-most-once, and exactly-once, depending on the technology stack and implementation. However, exactly-once delivery is often achieved through idempotency mechanisms rather than true, infrastructure-level exactly-once semantics.<sup id="cite_ref-:1_3-1" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:2_4-1" class="reference"><a href="#cite_note-:2-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p><p>Delivery patterns for both events and messages include publish/subscribe (one-to-many) and point-to-point (one-to-one). While request/reply is technically possible, it is more commonly associated with messaging patterns rather than pure event-driven systems. Events excel at state propagation and decoupled notifications, while messages are better suited for command execution, workflow orchestration, and explicit coordination.<sup id="cite_ref-:1_3-2" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:2_4-2" class="reference"><a href="#cite_note-:2-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p><p>Modern architectures commonly combine both approaches, leveraging events for distributed state change notifications and messages for targeted command execution and structured workflows based on specific timing, ordering, and delivery requirements.<sup id="cite_ref-:1_3-3" class="reference"><a href="#cite_note-:1-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:2_4-3" class="reference"><a href="#cite_note-:2-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Event_Evolution_Strategies">Event Evolution Strategies</h2></div>
<p>In <a href="Distributed_computing" title="Distributed computing">distributed systems</a>, event evolution poses challenges, such as managing inconsistent event schemas across services and ensuring compatibility during gradual system updates. Event evolution strategies in event-driven architectures (EDA) can ensure that systems can handle changes to events without disruption. These strategies can include versioning events, such as semantic versioning or schema evolution, to maintain backward and forward compatibility. Adapters can translate events between old and new formats, ensuring consistent processing across components. These techniques can enable systems to evolve while remaining compatible and reliable in complex, distributed environments.<sup id="cite_ref-:0_1-2" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Event_semaphore">Event semaphore</h2></div>
<p>In <a href="Computer_science" title="Computer science">computer science</a>, an <b>event</b> (also called <b>event semaphore</b>) is a type of <a href="Synchronization_(computer_science)" title="Synchronization (computer science)">synchronization</a> mechanism that is used to indicate to waiting processes when a particular condition has become true.
</p><p>An event is an <a href="Abstract_data_type" title="Abstract data type">abstract data type</a> with a boolean state and the following operations:
</p>
<ul><li><b>wait</b> - when executed, causes the suspension of the executing process until the state of the event is set to true. If the state is already set to true before wait was called, wait has no effect.</li>
<li><b>set</b> - sets the event's state to true, release all waiting processes.</li>
<li><b>clear</b> - sets the event's state to false.</li></ul>
<p>Different implementations of events may provide different subsets of these possible operations; for example, the implementation provided by <a href="Microsoft_Windows" title="Microsoft Windows">Microsoft Windows</a> provides the operations <b>wait</b> (WaitForObject and related functions), <b>set</b> (SetEvent), and <b>clear</b> (ResetEvent). An option that may be specified during creation of the event object changes the behaviour of SetEvent so that only a single thread is released and the state is automatically returned to false after that thread is released.
</p><p>Events short of <b>reset</b> function, that is, those which <a href="Programmable_interval_timer" title="Programmable interval timer">can be completed only once</a>, are known as futures.<sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> Monitors are, on the other hand, more general since they combine completion signaling with <a href="Mutual_exclusion" title="Mutual exclusion">mutex</a> and do not let the producer and consumer to execute simultaneously in the monitor making it an event+critical section.
</p>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Callback_(computer_programming)" title="Callback (computer programming)">Callback (computer programming)</a></li>
<li><a href="Database_trigger" title="Database trigger">Database trigger</a></li>
<li><a href="DOM_events" class="mw-redirect" title="DOM events">DOM events</a></li>
<li><a href="Event-driven_programming" title="Event-driven programming">Event-driven programming</a></li>
<li><a href="Exception_handling" title="Exception handling">Exception handling</a></li>
<li><a href="Interrupt_handler" title="Interrupt handler">Interrupt handler</a></li>
<li><a href="Interrupt" title="Interrupt">Interrupts</a></li>
<li><a href="Observer_pattern" title="Observer pattern">Observer pattern</a> (e.g., Event listener)</li>
<li><a href="Reactor_pattern" title="Reactor pattern">Reactor pattern</a> vs. <a href="Proactor_pattern" title="Proactor pattern">Proactor pattern</a></li>
<li><a href="Signal_programming" class="mw-redirect" title="Signal programming">Signal programming</a></li>
<li><a href="Virtual_synchrony" class="mw-redirect" title="Virtual synchrony">Virtual synchrony</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist">
<div class="mw-references-wrap"><ol class="references">
<li id="cite_note-:0-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-:0_1-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite class="citation book cs1"><i>Designing Event-Driven Systems</i>. O'Reilly Media. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>9781492038245</bdi>.</cite></span>
</li>
<li id="cite_note-:3-2"><span class="mw-cite-backlink">^ <a href="#cite_ref-:3_2-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:3_2-1"><sup><i><b>b</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFFowler2003" class="citation book cs1">Fowler, Martin (2003). <i>Patterns of Enterprise Application Architecture</i>. Addison-Wesley Professional. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-0321127426</bdi>.</cite></span>
</li>
<li id="cite_note-:1-3"><span class="mw-cite-backlink">^ <a href="#cite_ref-:1_3-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:1_3-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-:1_3-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-:1_3-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><cite id="CITEREFKleppmann2017" class="citation book cs1">Kleppmann, Martin (2017). <i>Designing Data-Intensive Applications: The Big Ideas Behind Reliable, Scalable, and Maintainable Systems</i>. O'Reilly Media. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1449373320</bdi>.</cite></span>
</li>
<li id="cite_note-:2-4"><span class="mw-cite-backlink">^ <a href="#cite_ref-:2_4-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:2_4-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-:2_4-2"><sup><i><b>c</b></i></sup></a> <a href="#cite_ref-:2_4-3"><sup><i><b>d</b></i></sup></a></span> <span class="reference-text"><cite class="citation book cs1"><i>Building Event-Driven Microservices: Leveraging Organizational Data at Scale</i>. <a href="ISBN_(identifier)" class="mw-redirect" title="ISBN (identifier)">ISBN</a>&nbsp;<bdi>978-1492057895</bdi>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><a rel="nofollow" class="external text" href="http://aosabook.org/en/500L/a-web-crawler-with-asyncio-coroutines.html#fn13">500 lines or less, "A Web Crawler With asyncio Coroutines" by A. Jesse Jiryu Davis and Guido van Rossum</a> says "implementation uses an asyncio.Event in place of the Future shown here. The difference is an Event can be reset, whereas a Future cannot transition from resolved back to pending."</span>
</li>
</ol></div></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li>Article <i><a rel="nofollow" class="external text" href="http://w3future.com/html/stories/callbacks.xml">Event Handlers and Callback Functions</a></i></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20070211111543/http://atddoc.cern.ch/Atlas/Notes/061/Note061-1.html">A High Level Design of the Sub-Farm Event Handler</a></li>
<li><a rel="nofollow" class="external text" href="http://www.w3.org/TR/xml-events/Overview.html#section-eventhandlers">An Events Syntax for XML</a></li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20110720015340/http://www.jini.org/wiki/Jini_Distributed_Events_Specification#Distributed_Events_and_Notifications">Distributed Events and Notifications</a></li>
<li><a rel="nofollow" class="external text" href="http://www.quirksmode.org/js/events_order.html">Event order</a></li>
<li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.xml/org/w3c/dom/events/Event.html">Java DOM Interface Event</a></code> <a href="Javadoc" title="Javadoc">Javadoc</a> documentation</li>
<li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/java/awt/event/package-summary.html">java.awt.event</a></code> Java package Javadoc API documentation</li>
<li><code><a rel="nofollow" class="external text" href="https://docs.oracle.com/en/java/javase/24/docs/api/java.desktop/javax/swing/event/package-summary.html">javax.swing.event</a></code> <a href="Java_package" title="Java package">Java package</a> Javadoc API documentation</li>
<li><a rel="nofollow" class="external text" href="https://web.archive.org/web/20110719030547/http://hikwww2.fzk.de/hik/orga/verdi/rs/Dokumentation/Cpp/Cpp/ioc/tasks/t90us014.htm">Write an Event Handler</a></li>
<li><a rel="nofollow" class="external text" href="https://greptime.com/blogs/2024-06-25-logs-and-metrics#how-greptimedb-revolutionizes-the-event-management">Understand Events (Logs and Metrics)</a></li>
<li><a rel="nofollow" class="external text" href="http://msdn.microsoft.com/en-us/library/ms682655(VS.85).aspx">Event Objects</a>, <i>Microsoft Developer Network</i></li>
<li><a rel="nofollow" class="external text" href="http://effbot.org/zone/thread-synchronization.htm">Thread Synchronization Mechanisms in Python</a> <a rel="nofollow" class="external text" href="https://web.archive.org/web/20201101025814/http://effbot.org/zone/thread-synchronization.htm">Archived</a> 2020-11-01 at the <a href="Wayback_Machine" title="Wayback Machine">Wayback Machine</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-06-17" href="https://en.wikipedia.org/wiki/?title=Event_(computing)&amp;oldid=1296039788">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>